import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionServlet; import org.apache.struts.util.MessageResources; import javax.servlet.http.HttpSession; import dwarf.MountainMgr; import dwarf.Mountain; public class EditMountainAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(); String mountainIdString = request.getParameter("mountain_id"); if(mountainIdString != null && form != null){ int mountain_id = Integer.parseInt(mountainIdString); Mountain m; MountainMgr mm = MgrFactory.getMountainMgr(); m = mm.Get(mountain_id); MountainForm mf = (MountainForm)form; mf.CopyFromMountain(m); } return (mapping.findForward("success")); } }